using System;
using System.BusinessObjects.Data;
using Blazing.BusinessObjects.Tagging;
using Iesi.Collections.Generic;

namespace Blazing.BusinessObjects.Cms
{
    [Serializable]
    public class Image : DataObject<Image>
    {
        #region Properties
        public int ID
        {
            get { return GetValue<int>("ID"); }
            set
            {
                BeginEdit();
                SetValue("ID", value);
            }
        }

        public string Name
        {
            get { return GetValue<string>("Name"); }
            set
            {
                BeginEdit();
                SetValue("Name", value);
            }
        }

        public string Description
        {
            get { return GetValue<string>("Description"); }
            set
            {
                BeginEdit();
                SetValue("Description", value);
            }
        }

        [NonSerialized]
        ImageType _imageType;
        public ImageType ImageType
        {
            get
            {
                return _imageType;
            }
            set
            {
                BeginEdit();
                _imageType = value;
            }
        }

        [NonSerialized]
        private ISet<TaxonomyTag> _imageTaxonomyTags = new HashedSet<TaxonomyTag>();
        public virtual ISet<TaxonomyTag> ImageTaxonomyTags
        {
            get
            {
                return _imageTaxonomyTags;
            }
            set
            {
                BeginEdit();
                SetLoadedRowState(value);
                _imageTaxonomyTags = value;
            }
        }

        public string AlternateText
        {
            get { return GetValue<string>("AlternateText"); }
            set
            {
                BeginEdit();
                SetValue("AlternateText", value);
            }
        }

        public DateTime RowStamp
        {
            get { return GetValue<DateTime>("RowStamp"); }
            set
            {
                SetValue("RowStamp", value);
            }
        }
        #endregion
    }
}
